<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="vue.js"></script>
</head>
<body>
    <div id="app">
        <h1>Vue <span>模版编译过程</span></h1>
        <p> {{msg}}</p>
        <comp @myClick = 'handler'></comp>
    </div>
    <script>
        Vue.component('comp',{
            template:'<div @click="fn">I am a comp.</div>',
            methods: {
                fn(){
                    this.$emit('handler','data')
                }
            },
        })
        const vm = new Vue({
            el:'#app',
            data:{
                msg:'Hello compiler'
            },
            methods:{
                myClick(){
                    console.log('test')
                }
            }
        })
        console.log(vm.$options.render)
    </script>
</body>
</html>